package com.ram.service.impl;

import com.ram.mapper.AssetInventoryDetailMapper;
import com.ram.pojo.AssetInventoryDetail;
import com.ram.service.AssetInventoryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import com.ram.pojo.AssetInventoryStatVO;
import com.ram.pojo.AssetInventoryCategoryStatVO;

@Service
public class AssetInventoryDetailServiceImpl implements AssetInventoryDetailService {
    @Autowired
    private AssetInventoryDetailMapper detailMapper;

    @Override
    public List<AssetInventoryDetail> list(Integer inventoryId) {
        return detailMapper.list(inventoryId);
    }

    @Override
    public AssetInventoryDetail getById(Integer id) {
        return detailMapper.getById(id);
    }

    @Override
    public void add(AssetInventoryDetail detail) {
        detail.setCreateTime(LocalDateTime.now());
        detailMapper.insert(detail);
    }

    @Override
    public void deleteById(Integer id) {
        detailMapper.deleteById(id);
    }

    @Override
    public List<AssetInventoryStatVO> statResultByInventoryId(Integer inventoryId) {
        return detailMapper.statResultByInventoryId(inventoryId);
    }

    @Override
    public List<AssetInventoryCategoryStatVO> statCategoryResultByInventoryId(Integer inventoryId) {
        return detailMapper.statCategoryResultByInventoryId(inventoryId);
    }
} 